<template>
	<gzPageWrapper
		ref="gzPageWrapperRef"
		:styles="{ background: '#f7f8fb' }"
		:up="{ textNoMore: '--暂无更多--', empty: { use: false } }"
		:down="{ use: true, auto: false }"
		:nav="{ use: false }"
		:scroll="{ top: 0, fixed: true }"
		@upCallback="upCallback"
	>
		<template #default>
			<view>
				<scoreList :scoreList="vdata.scoreList"/>
			</view>
		</template>
	</gzPageWrapper>
</template>
<script setup>
	import scoreList from './scoreList.vue'
	import { ref, reactive } from 'vue'
	import storageManage from '@/util/storageManage.js'
	import { $scoreRecord } from '@/http/apiManager.js'
	
	const gzPageWrapperRef = ref()
	
	const vdata = reactive({
		scoreList: [],	// 福分列表
	})
	
	/**
	 * 上拉刷新
	 */
	function upCallback(mescroll){
		const { num, size } = mescroll
		const pageNumber = num ? num : 1
		const pageSize = size ? size : 10
		$scoreRecord({ pageNumber, pageSize }).then(({ bizData }) => {
			if(pageNumber == 1) vdata.scoreList = []
			vdata.scoreList = vdata.scoreList.concat(bizData.records)
			mescroll.endSuccess(bizData.records.length,bizData.hasNext)
		}).catch(() => {
			mescroll.endErr()
		})
	}
</script>

<style lang="less">
</style>